<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>留言板</title>
    <link rel="stylesheet" href="css/index.min.css" />
    <script src="js/jquery-1.12.4.min.js"></script>
    <script src="js/template-native.js"></script>
    <!-- 创建模板 -->
    <script type="text/html" id="comments">
      <!-- 遍历数据，获取dom -->
      <% for(let i=0; i < comments.length; i++) { %>
      <li>
        <p class="floor"><%= comments[i].id %>楼<a href="javascript:;" class="delete" data-id="<%= comments[i].id %>">删除</a></p>
        <p class="author">层主：<span class="name"><%= comments[i].username %></span></p>
        <p class="content"><%= comments[i].content %></p>
      </li>
      <% } %>
    </script>
  </head>
  <body>
    <div class="main">
      <div class="post">
        <h2>大吉大利</h2>
        <p class="author">楼主：友人A</p>
        <p class="txt">新的一年，祝大家新年快乐，身体健康，升职加薪！</p>
      </div>
      <div class="reply">
        <h4>发表回复</h4>
        <p>用户名：<input type="text" class="user" /></p>
        <textarea class="editor"></textarea>
        <input type="button" value="发表" class="btn" />
      </div>
      <div class="cmts">
        <ul class="list"></ul>
      </div>
    </div>
    <script src="js/index.min.js"></script>
  </body>
</html>
